In the modern software development industry, applications are conceived and developed with a certain set of features. These applications are, in some instances, developed such that additional functionality may be added after the original development has been completed. In these circumstances, the additional functionality is created in autonomous units called add-ins. Special code must be created that facilitates the communication between the original application, sometimes referred to as the host, and the add-in. Further, an add-in could potentially be used by several hosts while a single host might use several add-ins.
There are typically five logical units of code that need to be created in order to enable add-in functionality. The first is the contract which defines, but does not implement, all of the functionality available to the add-in that is available from the host application and vice versa. These contracts are typically defined as a set of interfaces but could also be defined as abstract base classes, XML, etc. What matters is that they define a protocol for communication between the host and the add-in. The next components that need to be created are the host and add-in views. These views are typically implemented as a set of abstract base classes or interfaces that both the host and the add-in will program against. In other words, both of these views define “what” is to be implemented by each party, but lack specific implementations. Finally, adapters are created for both the add-in and the host. Adapters contain specific implementations that serve as translators to convert to and from the view and the contract.
In developing add-ins, the developer must write and maintain the source code for each of these components. This process can become very tedious because there are multiple places to update some of the same details. For example, a change to the contract can affect all four of the other components.